package com.ljyanimo.enums;

/**
 * @author Animo
 * @Date 2020/9/30
 * @Blog http://www.ljyanimo.com
 */
public enum ActivationEnum {

    YES(0,"激活"),
    NO(1,"冻结");

    private Integer code;

    private String value;

    ActivationEnum(Integer code, String value) {
        this.code = code;
        this.value = value;
    }

    public Integer getCode() {
        return code;
    }

    public String getValue() {
        return value;
    }

    public static ActivationEnum getOneByCode(Integer code){
        ActivationEnum[] values = ActivationEnum.values();
        for(ActivationEnum activationEnum : values){
            if(activationEnum.getCode().equals(code)){
                return activationEnum;
            }
        }
        return null;
    }
}
